package data;

import anaydis.sort.data.DataSetGenerator;
import org.jetbrains.annotations.NotNull;

import java.text.Collator;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;


public class StringDataSetGeneratorLocale implements DataSetGenerator {
    Locale locale;

    public StringDataSetGeneratorLocale(Locale locale){
        this.locale = locale;
    }

    public void setLocale(Locale l){
        locale = l;
    }

    @NotNull
    public List createAscending(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public List createDescending(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public List createRandom(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public Comparator getComparator() {
         return new Comparator<String>() {
            public int compare(String i, String j) {
                Collator collator = Collator.getInstance(locale);
                return collator.compare(i,j);
            }
        };
    }


}
